﻿
Imports std

Public Module consoleApplication3
    Public Class consoleApplicationStartParameters
        Public Shared unhandledExceptionhandler As UnhandledExceptionDelegate = Nothing
        Public Shared logfile As String = Nothing
        Public Shared counterUploaderStoroom As pair(Of String, Int32) = Nothing
        Public Shared logUploaderStoroom As pair(Of String, Int32) = Nothing
    End Class

    Public Sub startmain()
        consoleApplication2.startmain(consoleApplicationStartParameters.unhandledExceptionhandler, _
                                      consoleApplicationStartParameters.logfile)
        Dim rtn As Boolean
        If consoleApplicationStartParameters.counterUploaderStoroom Is Nothing Then
            rtn = counterUploader.initial()
        Else
            rtn = counterUploader.initial(consoleApplicationStartParameters.counterUploaderStoroom)
        End If
        If Not rtn Then
            raiseError(errorHandle.errorType.warning, "cannot initialize counterUploader.")
        End If

        If consoleApplicationStartParameters.logUploaderStoroom Is Nothing Then
            rtn = seriousLogUploader.initial()
        Else
            rtn = seriousLogUploader.initial(consoleApplicationStartParameters.counterUploaderStoroom)
        End If
        If Not rtn Then
            raiseError(errorHandle.errorType.warning, "cannot initialize seriousLogUploader.")
        End If
    End Sub
End Module
